//
//  ZWNavController.swift
//  SwiftFreshBeen
//
//  Created by Apple on 16/12/22.
//  Copyright © 2016年 zhouwnegang. All rights reserved.
//

import UIKit

class ZWNavController: UINavigationController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        //设置transluze
        self.navigationBar.isTranslucent = false
        
        let image = UIImage(named: "v2_my_avatar_bg_375x150_")
        
        self.navigationBar.setBackgroundImage(image, for: .default)
        
       
        
  
    }
    
 

    @objc private  func goback() {
        
        popViewController(animated: true)
        
    }
    
    override func pushViewController(_ viewController: UIViewController, animated: Bool) {
        
        let count = childViewControllers.count
        
        if count > 0 {
            
            viewController.navigationItem.leftBarButtonItem = UIBarButtonItem(imageName: "v2_goback_24x24_", target: self, action: #selector(goback))
            
            viewController.hidesBottomBarWhenPushed = true;
            
        }
        
        super.pushViewController(viewController, animated: true);
    }
    
}
